/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.buzzwords.behaviors;

import com.buzzwords.model.User;
import java.util.List;

/**
 *
 * @author potlow
 */
public abstract class UserBehavior extends DatabaseBehavior {

    @Override
    public boolean create(Object value) {
        User user;
        if (value instanceof User) {
            user = (User) value;
        } else {
            throw new IllegalArgumentException("Search value must be a User");
        }

        return persist(user);
    }

    @Override
    abstract public List<Object> read(Object value, List<String> properties);

    @Override
    public boolean update(Object value) {
        throw new UnsupportedOperationException("Not supported yet.");
        /*User user;
        if (value instanceof User) {
        user = (User) value;
        } else {
        throw new IllegalArgumentException("Search value must be a User");
        }

        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
        pm.makePersistent(e);
        } finally {
        pm.close();
        }
        } else {
        throw new UnauthorizedTitleChangeException(e, newTitle);
        }*/

    }

    @Override
    public boolean delete(Object value) {
        throw new UnsupportedOperationException("Not supported yet.");
        /*User user;
        if (value instanceof User) {
        user = (User) value;
        } else {
        throw new IllegalArgumentException("Search value must be a User");
        }

        return remove(user);*/
    }
}
